package com.study.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;

@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("demo_user") //对象与表一一对应 如果对象名和表名一致则表名可以省略
public class User implements Serializable {
    @TableId(type = IdType.AUTO) //主键自增
    //@TableField(value = "id") //如果名称和属性一致，可以省略
    private Integer id;
    //@TableField(value = "name")
    private String name;
    //@TableField(value = "age")
    private Integer age;
    //@TableField(value = "sex")
    private String sex;

}